WxPay.appid = Figaro.env.wechat_app_id
WxPay.mch_id = Figaro.env.wechat_pay_mch_id
WxPay.key = Figaro.env.wechat_pay_api_key
WxPay.debug_mode = true
WxPay.set_apiclient_by_pkcs12(File.read("/opt/apps/yun_shan_pi/apiclient_cert.p12"), Figaro.env.wechat_pay_mch_id) if Rails.env.production?

# cert, see https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=4_3
# using PCKS12
# WxPay.set_apiclient_by_pkcs12(File.read(pkcs12_filepath), pass)
# WxPay.apiclient_cert_path = '/path/to/your/cert/file.p12'
# if you want to use `generate_authorize_req` and `authenticate`
WxPay.appsecret = Figaro.env.wechat_appsecret

# optional - configurations for RestClient timeout, etc.
WxPay.extra_rest_client_options = {timeout: 2, open_timeout: 3}